#!/usr/bin/python
# -*- coding: utf-8 -*-

#PyGame support for playing the sound
import pygame

def play(dosya):
    freq = 44100     # audio CD kalitesi
    bitsize = -16    # 16 bit
    channels = 2     # 1 mono, 2 stereo
    buffer = 2048    
    pygame.mixer.init(freq, bitsize, channels, buffer)
# 0 'dan 1.0 kadar ses seviyesi
    pygame.mixer.music.set_volume(0.75)

    clock = pygame.time.Clock()
    try:
        pygame.mixer.music.load(dosya) #dosyayı yükler
    except pygame.error:
        print "%s adlı dosya bulunamadı.\n(%s)" % (dosya, pygame.get_error())
        return
    pygame.mixer.music.play()
    while pygame.mixer.music.get_busy():
        clock.tick(30)
 
 

